Repository navigation
SOF-8099: add client.files to upload, sign and delete account files - #51
Merged
Merged
Conversation
The platform no longer takes file bodies: it signs a PUT URL per file (files/signed-urls, putObject) for the declared size and content type, and the client PUTs the bytes to storage with the returned headers. FileEndpoints.upload does both steps, so a caller passes names and content only. get_download_urls and delete cover the other two routes. client.py is reformatted by the black hook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
k0stik
added a commit
to mat3ra/api-examples
that referenced
this pull request
Nov 3, 2026
The sign-and-PUT steps move to mat3ra-api-client (FileEndpoints, mat3ra/api-client#51), so the custom calculation notebooks call client.files.upload and notebooks_utils keeps only to_object_storage_input. Until that PR is released, pyproject.toml pins its commit and config.yml installs a wheel built from it (packages/); both go back to a released version before merging. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ubuntu-latest now resolves to Ubuntu 26.04, for which actions/setup-python has no 3.10.13 build, so the test job fails before it runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
timurbazhirov
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
client.files(FileEndpoints) for the account's object storage folder ("Dropbox"), so notebooks and scripts upload with one call:upload(files, account_id=None): text is encoded as UTF-8; the platform signs one PUT URL per file for its exact size and guessed content type (POST files/signed-urls,putObject), and each file is PUT to storage with the returned headers. Returnsname,key,size,bucket,region,providerper file.get_upload_urls(files),get_download_urls(names),delete(names): the routes themselves. A name ending in/is a folder.Why
The platform no longer accepts file bodies (mat3ra/web-app#3026): the bytes go straight to storage. The two steps (sign, PUT with the signed headers) lived in api-examples'
notebooks_utils; here they sit next to the other endpoints and keep the notebooks simple (mat3ra/api-examples#408).client.pyis reformatted by the black pre-commit hook (it was not black-formatted onmain); the only real change there isself.files.Testing
tests/py/unit/test_files.py(signing payload, PUT with signed headers, records, storage refusal, download URLs, delete).requests, like the rest of the client; checked through api-examples#408.🤖 Generated with Claude Code